<?php namespace Common\Model;
use Hdphp\Model\Model;

class Type extends Model{
	protected $table = "type";

	protected $validate = array(
		array('tname','required','类型属性不能为空',3,3)
	);

	public function addData($tname){
		if($this->create()){
			$this->add(array('tname'=>$tname));
			return true;
		}
		return false;
	}

	public function editData(){
		if($this->create()){
			$this->save();
			return true;
		}
		return false;
	}
}



 ?>